# -*- coding:utf-8 -*-
#! python3
from facecat import *

gPaint = FCPaint() #创建绘图对象

#消息循环
def WndProc(hwnd,msg,wParam,lParam):
	return WndProcDefault(gPaint,hwnd,msg,wParam,lParam)

#初始化窗体
createMainWindow(gPaint, "facecat-py", WndProc)
current_file_path = os.path.abspath(__file__)
current_file_dir = os.path.dirname(current_file_path)
file0 = open(current_file_dir + "\\xml\\textboxexample.xml", encoding="UTF-8")
xml = file0.read()
file0.close()
renderFaceCat(gPaint, xml)
gPaint.init()
#获取第二页
tabPage = findViewByName("TabPage2", gPaint.views)
textBox = FCTextBox()
textBox.viewName = "textBox"
textBox.location = FCPoint(100, 100)
textBox.size = FCSize(100, 20)
addViewToParent(textBox, tabPage)
textBox.text = "mytext"
textBox.backColor = "rgb(255,0,0)"
textBox.font = "Default,14"
print(textBox.text)
showWindow(gPaint)